//import path from 'path';

export const allRouters = [
    {
        path: '/login',
        component: () => import('@/views/login/login.vue'),//路由懒加载
        name: 'login',// 命名路由
        meta: {
            title: "登录",
            hidden: true,
            icon:'House',
        }
    },
    {
        path: '/404',
        component: () => import('@/views/404/404.vue'),
        name: '404',
        meta: {
            title: "404",
            hidden: true,
            icon:'House',
        }
    },
    {
        path: '/',
        component: () => import('@/views/main/index.vue'),
        name: '/',
        meta: {
            title: "",
            hidden: false,
            icon:'',
        },
        redirect:'/home',
        children:[
            {
                path:'/home',
                component: ()=> import('@/views/home/index.vue'),
                name:'home',
                meta:{
                    title: "首页",
                    hidden: false,
                    icon:'House'
                }
            } 
        ]

    },
    {
        path: '/dataScreen',
        component: () => import('@/views/dataScreen/index.vue'),
        name:'Screen',
        meta: {
            title: "数据大屏",
            hidden: false,
            icon:'Monitor'
        }
    },
    {
        path: '/goodsMange',
        component: () => import('@/views/main/index.vue'),  //在主页面切换内容区的关键
        name:'goodsMange',
        meta:{
            title:'商品管理',
            hidden:false,
            icon:'Goods',
        },
        redirect: '/goodsMange/SKU',
        children: [
            {
                path: '/goodsMange/SKU',
                component: ()=> import('@/views/goodsManage/SKU/index.vue'),
                name:'sku',
                meta:{
                    title:'SKU',
                    hidden:false,
                    icon:'Goods',
                },
            },
            {
                path: '/goodsMange/SPU',
                component: ()=> import('@/views/goodsManage/SPU/index.vue'),
                name:'spu',
                meta:{
                    title:'SPU',
                    hidden:false,
                    icon:'Goods',
                },
                
            }
        ]
    },
    {
        path: '/:pathMatch(.*)*',
        redirect: '/404',
        meta: {
            title: "登录",
            hidden: true,
            icon:'House',
        }
    }

]